"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HaoEncrypt = void 0;
class HaoEncrypt {
    static encode(str) {
        let result = "";
        for (let i = 0; i < str.length; i++) { //遍历字符串
            let code = str.charCodeAt(i); // //逐个提取每个字符，并获取Unicode编码值
            if (i % 2 == 0) {
                code += 3;
            }
            else {
                code += 1;
            }
            result += String.fromCharCode(code);
        }
        return result;
    }
    static decode(str) {
        let result = "";
        for (let i = 0; i < str.length; i++) { //遍历字符串
            let code = str.charCodeAt(i); // //逐个提取每个字符，并获取Unicode编码值
            if (i % 2 == 0) {
                code -= 3;
            }
            else {
                code -= 1;
            }
            result += String.fromCharCode(code);
        }
        return result;
    }
}
exports.HaoEncrypt = HaoEncrypt;
